/*
 * DXEngine.h
 *
 *  Created on: Oct 28, 2012
 *      Author: Bhupendra Aole
 */

#ifndef DXENGINE_H_
#define DXENGINE_H_

#include <d3d11.h>

namespace aole {

class DXEngine {
private:
	D3D_DRIVER_TYPE driverType;
	D3D_FEATURE_LEVEL featureLevel;
	ID3D11Device* pd3dDevice;
	ID3D11DeviceContext* pImmediateContext;
	IDXGISwapChain* pSwapChain;
	ID3D11RenderTargetView* pRenderTargetView;

public:
	DXEngine() :
			driverType( D3D_DRIVER_TYPE_NULL ), featureLevel(
					D3D_FEATURE_LEVEL_11_0 ), pd3dDevice( NULL ), pImmediateContext(
					NULL ), pSwapChain( NULL ), pRenderTargetView( NULL ) {
	}
	HRESULT InitDevice( HWND hWnd );
	void CleanupDevice();
	void renderBegin();
	void renderEnd();
	ID3D11Device* getDevice() {
		return pd3dDevice;
	}
	ID3D11DeviceContext* getContext() {
		return pImmediateContext;
	}
};

} /* namespace aole */
#endif /* DXENGINE_H_ */
